package com.ruoyi.shop.domain;

import java.math.BigDecimal;

import com.ruoyi.rva.framework.domain.RvaBaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 订单项对象 shop_goods_order_item
 * 
 * @author jiaodacailei
 * @date 2022-06-12
 */
public class ShopGoodsOrderItem extends RvaBaseEntity
{
    private static final long serialVersionUID = 1L;

    public ShopGoodsOrderItem () {}

    public ShopGoodsOrderItem(ShopGoodsCart cart, ShopGoods goods) {
        this.setGoodsCount(cart.getGoodsCount());
        this.setGoodsId(cart.getGoodsId());
        this.setGoodsName(goods.getName());
        this.setGoodsImages(goods.getImages());
        this.setGoodsPrice(goods.getPrice());
        this.setName(goods.getName() + "*" + cart.getGoodsCount());
        this.setSubTotal(goods.getPrice().multiply(cart.getGoodsCount()));
        this.setIdx(cart.getIdx());
    }
    /** ID */
    private Long id;

    /** 名称 */
    @Excel(name = "名称")
    private String name;

    /** 排序 */
    @Excel(name = "排序")
    private Integer idx;

    /** 其他数据 */
    @Excel(name = "其他数据")
    private String data;

    /** 订单ID */
    @Excel(name = "订单ID")
    private Long orderId;

    /** 商品ID */
    @Excel(name = "商品ID")
    private Long goodsId;

    /** 商品名称 */
    @Excel(name = "商品名称")
    private String goodsName;

    /** 商品价格 */
    @Excel(name = "商品价格")
    private BigDecimal goodsPrice;

    /** 商品数量 */
    @Excel(name = "商品数量")
    private BigDecimal goodsCount;

    /** 小计 */
    @Excel(name = "小计")
    private BigDecimal subTotal;

    /** 商品图片 */
    @Excel(name = "商品图片")
    private String goodsImages;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setIdx(Integer idx) 
    {
        this.idx = idx;
    }

    public Integer getIdx() 
    {
        return idx;
    }
    public void setData(String data) 
    {
        this.data = data;
    }

    public String getData() 
    {
        return data;
    }
    public void setOrderId(Long orderId) 
    {
        this.orderId = orderId;
    }

    public Long getOrderId() 
    {
        return orderId;
    }
    public void setGoodsId(Long goodsId) 
    {
        this.goodsId = goodsId;
    }

    public Long getGoodsId() 
    {
        return goodsId;
    }
    public void setGoodsName(String goodsName) 
    {
        this.goodsName = goodsName;
    }

    public String getGoodsName() 
    {
        return goodsName;
    }
    public void setGoodsPrice(BigDecimal goodsPrice) 
    {
        this.goodsPrice = goodsPrice;
    }

    public BigDecimal getGoodsPrice() 
    {
        return goodsPrice;
    }
    public void setGoodsCount(BigDecimal goodsCount) 
    {
        this.goodsCount = goodsCount;
    }

    public BigDecimal getGoodsCount() 
    {
        return goodsCount;
    }
    public void setSubTotal(BigDecimal subTotal) 
    {
        this.subTotal = subTotal;
    }

    public BigDecimal getSubTotal() 
    {
        return subTotal;
    }
    public void setGoodsImages(String goodsImages) 
    {
        this.goodsImages = goodsImages;
    }

    public String getGoodsImages() 
    {
        return goodsImages;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("idx", getIdx())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("data", getData())
            .append("orderId", getOrderId())
            .append("goodsId", getGoodsId())
            .append("goodsName", getGoodsName())
            .append("goodsPrice", getGoodsPrice())
            .append("goodsCount", getGoodsCount())
            .append("subTotal", getSubTotal())
            .append("goodsImages", getGoodsImages())
            .toString();
    }
}
